(function(){
	var date = new Date();
	
	var days = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
	
	var sayHello = function(){ //打招呼
		var hour = date.getHours();
		
		if(hour >= 6 && hour < 12){
			return "上午好";
		}else if(hour >= 12 && hour < 18){
			return "下午好";
		}else if(hour >= 18 && hour < 23){
			return "晚上好";
		}else {
			return "深夜了，早点休息";
		}
	};
	
	var getWeekDay = function(){ //获取星期
		return days[date.getDay()];
	};
	
	//将日期添加到指定的dom元素上
	var getStrDate = function(domId){
		var obj = $("#" + domId);
		window.setInterval(function(){
			var time = mini.formatDate (new Date(),"yyyy-MM-dd HH:mm:ss");
			obj.html(time);
		}, 1000);
	};
	
	/*window.dateutil = {};
	dateutil.sayCall = sayHello;
	dateutil.getWeekDay = getWeekDay;
	dateutil.getStrDate = getStrDate;*/
	getStrDate(arguments[2]);
	$("#" + arguments[0]).html(sayHello());
	$("#" + arguments[1]).html(getWeekDay());
})("call","week","time");